package frame;

import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;

public class FlowLayoutDemo {
	private JFrame frame;
	public FlowLayoutDemo(){
		frame=new JFrame();
		frame.setSize(700, 420);
		frame.setLocation(400, 200);
		frame.setVisible(true);
		frame.setTitle("流布局");
		frame.setDefaultCloseOperation(frame.EXIT_ON_CLOSE);
		frame.setLayout(new FlowLayout());//流式布局
		JButton jb=new JButton("登录");
		frame.add(jb);
		JLabel jl=new JLabel("学生信息录入系统");
		frame.add(jl);
		//JPanel jp=new JPanel();
	}
	
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			
			@Override
			public void run() {
				new FlowLayoutDemo();
			}
		});
	}
}
